<template>
    <div class="box pic">
        <a-collapse ghost>
            <a-collapse-panel header="风格一致性">
                <div class="tips">(--sref)请上传1-3张风格相识的图片，图片总大小上限20M</div>
                <a-upload v-model:file-list="imgList" list-type="picture-card" :before-upload="beforeUpload" @change="onChange" @preview="handlePreview">
                    <div v-if="imgList.length < 3">
                        <plus-outlined />
                    </div>
                </a-upload>
            </a-collapse-panel>
        </a-collapse>
    </div>
</template>
<script setup lang="ts">
import { ref } from "vue";

const imgList = ref<{ originFileObj: File }[]>([]);

const emits = defineEmits(["change"]);

const beforeUpload = () => {
    return false;
};

const handlePreview = () => {};
const onChange = () => {
    emits(
        "change",
        imgList.value.map((item) => item.originFileObj)
    );
};
</script>
